From: Owen W. Taylor Date: Wed, 19 Jan 2011 16:34:10 +0000 (-0500) Subject: StIcon: round icon size to an integer X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~9235 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=28adc03cceddce342ce496b60304a029a9f509c9;p=gnome-shell.git StIcon: round icon size to an integer Instead of converting a CSS-specified length to an integer by truncation, round. This means that sizes specified by converting a pixel value into non-px terms will work reliably instead of potentially being off-by-one. --- diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 6101107f1..78519c483 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -279,7 +279,7 @@ st_icon_style_changed (StWidget *widget) StThemeNode *theme_node = st_widget_get_theme_node (widget); StIconPrivate *priv = self->priv; - priv->theme_icon_size = st_theme_node_get_length (theme_node, "icon-size"); + priv->theme_icon_size = (int)(0.5 + st_theme_node_get_length (theme_node, "icon-size")); st_icon_update_icon_size (self); st_icon_update (self); }